package DP;

/**
 * @author 曹见朋
 * @create 2024-06-16-20:48
 */
public class Main300 {

    // TODO 300. 最长递增子序列
    public static int lengthOfLIS(int[] nums) {
        int n = nums.length;
        int[] dp = new int[n];

        for(int i = 0; i < n; i++){
            dp[i] = 1;
        }
        int result = 0;
        for(int i = 0; i < n; i++){
            for(int j = 0; j < i; j++){
                if(nums[i] > nums[j]){
                    dp[i] = Math.max(dp[i], dp[j] + 1);
                }
            }
            result = Math.max(result, dp[i]);
        }
        return result;
    }

    public static void main(String[] args) {
        int[] nums = new int[]{7,7,7,7,7,7,7};
        System.out.println(lengthOfLIS(nums));

    }
}
